import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

public class 计算周几 {
    public static void main(String[] args) {
        
        LocalDate nowDay = LocalDate.of(2024, 10, 12);

        LocalDate targetDay = nowDay.plusDays(40);

        System.out.println("相差几天-"+targetDay.until(nowDay, ChronoUnit.DAYS));
        System.out.println("目标日期="+targetDay+"，星期"+targetDay.getDayOfWeek().getValue());

    }
}
